<%@ page language="java" %>

<%@ page import="java.util.ArrayList,
                 com.scalar.chiptrack.commons.SessionKeys,
                 com.scalar.chiptrack.utils.ConfigManager,
				 com.scalar.chiptrack.commons.Constants,
				 com.scalar.chiptrack.users.Functionality,
				 com.scalar.chiptrack.users.User,
				 com.scalar.chiptrack.operations.assemblyrelease.AssemblyRelease,
                 com.scalar.chiptrack.operations.assemblyrelease.forms.AssemblyReleaseForm"%>

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>
<chiptrack:checkLogon sourcePage="/assemblyRelease.do" />
<%String chipTracContext = "/" + ConfigManager.getChipTracContext();
  AssemblyRelease assemblyRelease = (AssemblyRelease) request.getAttribute("assemblyRelease");
%>
<HTML>
<HEAD><TITLE>Scalarsoft - ChipTrac </TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type="text/css" rel="stylesheet"></HEAD>
<script src="<%=chipTracContext%>/jsp/includes/scripts/functions.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/validations.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/assembly_release.js"></script>

<style>
<!--
.HEADING     { cursor: hand; font-family: Verdana; font-size: 8pt; color: #000000;
               background-color: #FFFFFFF; font-weight: bold;
               border: 0 solid #000000  COLOR: #000000;}
-->
</style>

<SCRIPT language="JavaScript">
	var focusNum = 0;
	var dateElement = "";
	function openCalendar( dateValue )
	{
		dateElement = dateValue;
		newWindow = window.open('<%=chipTracContext%>/jsp/includes/calendar.html','optionsPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=no,width=180,height=440,resizable=no');
		newWindow.moveTo(550,180);
		newWindow.focus();
	}

	function assignDate( passedValue )
	{
		if ( typeof ( dateElement.value ) == 'undefined')
		{
			document.assemblyReleaseForm.releaseDate.value = passedValue;
		}
		else
		{
			dateElement.value=passedValue;
		}
		window.focus();
	}

    function addLotQty()
    {
		var noOfRows = document.assemblyReleaseForm.noOfRows.value;
		var totalWaferQty = 0;
		var totalDieQty = 0;

        for( var i = 0; i < noOfRows; i++ )
        {
			var tempWaferQty = 0;
			var tempDieQty = 0;
            if( typeof document.assemblyReleaseForm['lotList[' + i + '].selectLot'] != "undefined" )
            {
                if( document.assemblyReleaseForm['lotList[' + i + '].selectLot'].checked == true )
                {
                if( document.assemblyReleaseForm['lotList[' + i + '].processTypeName'].value == 'Die Bank' || document.assemblyReleaseForm['lotList[' + i + '].processTypeName'].value == 'SORT' )
                {
                    tempDieQty  = parseInt(tempDieQty) + parseInt(document.assemblyReleaseForm['lotList[' + i + '].dieQuantityPull'].value);
                }
			    tempWaferQty  = parseInt(tempWaferQty) + parseInt(document.assemblyReleaseForm['lotList[' + i + '].waferQuantityPull'].value * document.assemblyReleaseForm['lotList[' + i + '].grossDiePerWafer'].value );
                if( ('<%=Constants.ASSEMBLY_RELEASE_CANCELLED_STATUS%>' == document.assemblyReleaseForm.assemblyReleaseStatus.value ) || ( '<%=Constants.ASSEMBLY_RELEASE_SHIPPED_STATUS%>' == document.assemblyReleaseForm.assemblyReleaseStatus.value ) )
                {
                    document.assemblyReleaseForm['lotList[' + i + '].selectLot'].disabled = true;
                    document.assemblyReleaseForm['lotList[' + i + '].waferQuantityPull'].disabled = true;
                    document.assemblyReleaseForm['lotList[' + i + '].dieQuantityPull'].disabled = true;
                }

                else
                {
                    //if( document.assemblyReleaseForm['lotList[' + i + '].processTypeName'].value != 'SORT')
                    //{
                        document.assemblyReleaseForm['lotList[' + i + '].waferQuantityPull'].disabled = false;
                        if( document.assemblyReleaseForm['lotList[' + i + '].processTypeName'].value == 'Die Bank' || document.assemblyReleaseForm['lotList[' + i + '].processTypeName'].value == 'SORT' )
                        {
                            if( document.assemblyReleaseForm['lotList[' + i + '].wafersListCount'].value > 0 )
                            {
                                document.assemblyReleaseForm['lotList[' + i + '].waferQuantityPull'].disabled = true;
                                document.assemblyReleaseForm['lotList[' + i + '].dieQuantityPull'].disabled = true;
                            }else{
                                document.assemblyReleaseForm['lotList[' + i + '].waferQuantityPull'].disabled = false;
                                document.assemblyReleaseForm['lotList[' + i + '].dieQuantityPull'].disabled = false;
                            }
                        }
                    //}
                }
			}
            else
            {
                if( ('<%=Constants.ASSEMBLY_RELEASE_CANCELLED_STATUS%>' == document.assemblyReleaseForm.assemblyReleaseStatus.value ) || ( '<%=Constants.ASSEMBLY_RELEASE_SHIPPED_STATUS%>' == document.assemblyReleaseForm.assemblyReleaseStatus.value ) )
                {
                    document.assemblyReleaseForm['lotList[' + i + '].selectLot'].disabled = true;
                    document.assemblyReleaseForm['lotList[' + i + '].waferQuantityPull'].disabled = true;
                    document.assemblyReleaseForm['lotList[' + i + '].dieQuantityPull'].disabled = true;
                }
            }
            // If Status is Cancelled or Closed then Disable all Wafer Check Boxes.
            if( ('<%=Constants.ASSEMBLY_RELEASE_CANCELLED_STATUS%>' == document.assemblyReleaseForm.assemblyReleaseStatus.value ) || ( '<%=Constants.ASSEMBLY_RELEASE_SHIPPED_STATUS%>' == document.assemblyReleaseForm.assemblyReleaseStatus.value ) )
            {
                // Disable all the Check boxes for Sort - Wafers.
                for( j = 0; j < document.assemblyReleaseForm['lotList[' + i + '].wafersListCount'].value; j++ )
                {
                    document.assemblyReleaseForm['lotList[' + i + '].assemblyReleaseWaferInfoList[' + j + '].waferSelected'].disabled = true;
                }
            }
			totalWaferQty = parseInt(totalWaferQty) + tempWaferQty;
			totalDieQty = parseInt(totalDieQty) + tempDieQty;
        }
        }
		document.assemblyReleaseForm.totalWaferQtyPulled.value = parseInt(totalWaferQty);
		document.assemblyReleaseForm.totalDieQtyPulled.value = parseInt(totalDieQty);
        document.assemblyReleaseForm.totalQtyPulled.value = parseInt(totalWaferQty) + parseInt(totalDieQty);
	}

function addWaferQty()
    {
		var noOfRows = document.assemblyReleaseForm.noOfRows.value;
		var totalQty = 0;
        var finalTotalDieQty = 0;
		for( var i = 0; i < noOfRows; i++ )
        {
    		var noOfWafers = document.assemblyReleaseForm['lotList[' + i + '].wafersListCount'].value;
			var tempLotQty = 0;
			var check = 0;
			for( var j = 0; j < noOfWafers; j++ )
            {
			    document.assemblyReleaseForm['lotList[' + i + '].selectLot'].checked = false;
				if( document.assemblyReleaseForm['lotList[' + i + '].assemblyReleaseWaferInfoList[' + j + '].waferSelected'].checked == true )
				{
					tempLotQty  = parseInt(tempLotQty) + parseInt(document.assemblyReleaseForm['lotList[' + i + '].assemblyReleaseWaferInfoList[' + j + '].totalBinQuantity'].value);
					check = 1;
				}
			}
            if( noOfWafers > 0 )
            {
			    document.assemblyReleaseForm['lotList[' + i + '].dieQuantityPull'].value = tempLotQty;
			    totalQty = parseInt(totalQty) + tempLotQty;
            }
            else
            {
                tempLotQty = document.assemblyReleaseForm['lotList[' + i + '].dieQuantityPull'].value;
			    totalQty = parseInt(totalQty) + parseInt(tempLotQty);
            }
			if( check == 1 )
			{
				document.assemblyReleaseForm['lotList[' + i + '].selectLot'].checked = true;
			}
            finalTotalDieQty = parseInt( finalTotalDieQty ) + parseInt( document.assemblyReleaseForm['lotList[' + i + '].dieQuantityPull'].value) ;
		}
		document.assemblyReleaseForm.totalDieQtyPulled.value = parseInt( finalTotalDieQty );
        document.assemblyReleaseForm.totalQtyPulled.value = parseInt(document.assemblyReleaseForm.totalWaferQtyPulled.value) + parseInt(finalTotalDieQty);
        //document.assemblyReleaseForm.totalQtyPulled.value = parseInt( finalTotalDieQty );
	}

    function callFlash(rowName)
    {
        var obj = eval("document.all."+rowName);

		if(obj.style.display == "none"){
			obj.style.display = "block";
		}else{
            obj.style.display = "none";
		}
    }

   // This method is called when the user checks the Select check Box in a ROW.
   function addLotQuantity( rowNo )
    {
    	var noOfRows = document.assemblyReleaseForm.noOfRows.value;
		var totalQty = 0;
        var processType = '';
        var waferTotal = 0;
        var dieTotal = 0;

        var pa = document.getElementById("lotsMessage");
	    pa.innerHTML = "";

        processType = document.assemblyReleaseForm['lotList[' + rowNo + '].processTypeName'].value;

        if( processType != 'Sort' )
        {
            if( processType == 'FAB' || processType == 'Wafer Store' )
            {
                if( document.assemblyReleaseForm['lotList[' + rowNo + '].waferQuantityPull'].value  == 0 )
                {
                    document.assemblyReleaseForm['lotList[' + rowNo + '].waferQuantityPull'].value = document.assemblyReleaseForm['lotList[' + rowNo + '].waferQuantity'].value;
                }
                if( document.assemblyReleaseForm['lotList[' + rowNo + '].selectLot'].checked == true )
                {
                    document.assemblyReleaseForm['lotList[' + rowNo + '].waferQuantityPull'].disabled = false;
                }
                else
                {
                    document.assemblyReleaseForm['lotList[' + rowNo + '].waferQuantityPull'].disabled = true;
                    document.assemblyReleaseForm['lotList[' + rowNo + '].waferQuantityPull'].value = 0;
                }
            }
            else
            {
                if( document.assemblyReleaseForm['lotList[' + rowNo + '].selectLot'].checked == true )
                {
                    document.assemblyReleaseForm['lotList[' + rowNo + '].waferQuantityPull'].disabled = false;
                    document.assemblyReleaseForm['lotList[' + rowNo + '].dieQuantityPull'].disabled = false;

                    if( document.assemblyReleaseForm['lotList[' + rowNo + '].waferQuantityPull'].value  == 0 )
                    {
                        document.assemblyReleaseForm['lotList[' + rowNo + '].waferQuantityPull'].value = document.assemblyReleaseForm['lotList[' + rowNo + '].waferQuantity'].value;
                    }
                    if( document.assemblyReleaseForm['lotList[' + rowNo + '].dieQuantityPull'].value  == 0 )
                    {
                        document.assemblyReleaseForm['lotList[' + rowNo + '].dieQuantityPull'].value = document.assemblyReleaseForm['lotList[' + rowNo + '].dieQuantity'].value;
                    }
                }
                else
                {
                    document.assemblyReleaseForm['lotList[' + rowNo + '].waferQuantityPull'].disabled = true;
                    document.assemblyReleaseForm['lotList[' + rowNo + '].dieQuantityPull'].disabled = true;
                    document.assemblyReleaseForm['lotList[' + rowNo + '].waferQuantityPull'].value = 0;
                    document.assemblyReleaseForm['lotList[' + rowNo + '].dieQuantityPull'].value = 0;
                }
            }
        }

        for( i = 0; i < noOfRows; i ++ )
        {
            if( document.assemblyReleaseForm['lotList[' + i + '].selectLot'].checked == true )
            {
                if( parseInt( document.assemblyReleaseForm['lotList[' + i + '].waferQuantityPull'].value ) > parseInt( document.assemblyReleaseForm['lotList[' + i + '].waferQuantity'].value ) )
                {
                    pa.innerHTML = "<li> Wafer Quantity to Pull cannot be Greater than Current Wafer Quantity.";
                    //document.assemblyReleaseForm['lotList[' + i + '].waferQuantityPull'].focus();
                    document.assemblyReleaseForm['lotList[' + i + '].waferQuantityPull'].select();
                    return;
                }
                waferTotal = parseInt( waferTotal ) + parseInt( document.assemblyReleaseForm['lotList[' + i + '].waferQuantityPull'].value * document.assemblyReleaseForm['lotList[' + i + '].grossDiePerWafer'].value );
                if( document.assemblyReleaseForm['lotList[' + i + '].processTypeName'].value == 'Die Bank' || document.assemblyReleaseForm['lotList[' + i + '].processTypeName'].value == 'SORT' )
                {
                    if( parseInt( document.assemblyReleaseForm['lotList[' + i + '].dieQuantityPull'].value ) > parseInt( document.assemblyReleaseForm['lotList[' + i + '].dieQuantity'].value ) )
                    {
                        pa.innerHTML = "<li> Die Quantity to Pull cannot be Greater than Current Die Quantity.";
                        document.assemblyReleaseForm['lotList[' + i + '].dieQuantityPull'].focus();
                        document.assemblyReleaseForm['lotList[' + i + '].dieQuantityPull'].select();
                        return;
                    }
                }
                dieTotal = parseInt( dieTotal ) + parseInt( document.assemblyReleaseForm['lotList[' + i + '].dieQuantityPull'].value );
            }
            document.assemblyReleaseForm.totalWaferQtyPulled.value = waferTotal;
            document.assemblyReleaseForm.totalDieQtyPulled.value = dieTotal;
            document.assemblyReleaseForm.totalQtyPulled.value =  ( waferTotal + dieTotal );
       }
    }

function saveAssemblyStatus()
{
	var pa =  document.getElementById("lotsMessage");
    var err =  document.getElementById("errors");
	var temp = "";

	pa.innerHTML = "";
    err.innerHTML = "";

	var form = document.assemblyReleaseForm;
	var poNumVal = form.poNumber.value.trim();

	var noOfRows = form.noOfRows.value;

	if ( parseInt( poNumVal.length ) < 1 )
	{
		err.innerHTML = "<li> Please enter a Purchase Order Number ";
		form.poNumber.focus();
		return;
	}

    if ( !validateReleaseDate ( form.releaseDate.value ) )
	{
		return;
	}

    var dateValue = form.releaseDate.value.split("/");
    if( isDateAfter(dateValue[0],dateValue[1],dateValue[2] ) == true ) {
        err.innerHTML = "<li> Release Date should not be less than todays date";
        form.releaseDate.select();
        form.releaseDate.focus();
        return;
    }

    /*for( j = 0; j < noOfRows; j++ )
    {
        document.assemblyReleaseForm['lotList[' + j + '].waferQuantityPull'].disabled = false;
        document.assemblyReleaseForm['lotList[' + j + '].dieQuantityPull'].disabled = false;
    }*/
    var check=false;
    //Added By SureshReddy on [12 JULY 2004]
    for( i = 0; i < noOfRows; i++ )
    {
        if (document.assemblyReleaseForm['lotList[' + i + '].selectLot'].checked) {
            check=true;
        }

        if( document.assemblyReleaseForm['lotList[' + i + '].selectLot'].checked == true )
        {
            if( document.assemblyReleaseForm['lotList[' + i + '].waferQuantityPull'].value == 0 && document.assemblyReleaseForm['lotList[' + i + '].dieQuantityPull'].value == 0 ) {
                pa.innerHTML = "<li> Quatity Pulled cannot be zero.";
                return;
            }

            if( parseInt( document.assemblyReleaseForm['lotList[' + i + '].waferQuantityPull'].value ) > parseInt( document.assemblyReleaseForm['lotList[' + i + '].waferQuantity'].value ) )
            {
                pa.innerHTML = "<li> Wafer Quantity to Pull cannot be Greater than Current Wafer Quantity.";
                document.assemblyReleaseForm['lotList[' + i + '].waferQuantityPull'].focus();
                document.assemblyReleaseForm['lotList[' + i + '].waferQuantityPull'].select();
                return;
            }

            if( document.assemblyReleaseForm['lotList[' + i + '].processTypeName'].value == 'Die Bank' || document.assemblyReleaseForm['lotList[' + i + '].processTypeName'].value == 'SORT' )
            {
                if( parseInt( document.assemblyReleaseForm['lotList[' + i + '].dieQuantityPull'].value ) > parseInt( document.assemblyReleaseForm['lotList[' + i + '].dieQuantity'].value ) )
                {
                    pa.innerHTML = "<li> Die Quantity to Pull cannot be Greater than Current Die Quantity.";
                    //document.assemblyReleaseForm['lotList[' + i + '].dieQuantityPull'].focus();
                    document.assemblyReleaseForm['lotList[' + i + '].dieQuantityPull'].select();
                    return;
                }
            }

        }

    }
    if(check==false){
        pa.innerHTML = "<li> Select at least one check box to Save.";
        return;
    }
    form.action.value = "save";
	form.submit();
}

</SCRIPT>

<%
    int forDieBank = 0;
    int forSort = 0;
    int forWaferStore = 0;
    int forFab = 0;
    int rowCount = 0;
%>

<BODY bgColor="#ffffff" leftMargin="0" topMargin="0" marginheight="0" marginwidth="0" onload = "javascript:addLotQty();" >

<!-- Top Header Start-->
<%@ include file="/jsp/includes/header.jsp" %>
<!-- Top Header End-->

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
	<TR>
	<TD width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>

	<!-- Side Navigation start -->
	<%@ include file="/jsp/operations/releaseMenu.jsp" %></TD>
	<!-- end of the side navigations -->

	<TD bgcolor="#ffffff">
	<IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
	<TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
	<TD valign="top" width="100%">

	<IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
	<BR>
	<html:form action="/assemblyRelease" method="POST" >

		<% int i = 10; %>
		<logic:equal name="assemblyReleaseForm" property="assemblyReleaseStatus" value="<%=Constants.ASSEMBLY_RELEASE_CANCELLED_STATUS%>" >
		<% i = 9; %>
		</logic:equal>

		<logic:equal name="assemblyReleaseForm" property="assemblyReleaseStatus" value="<%=Constants.ASSEMBLY_RELEASE_CANCELLED_STATUS%>" >
		<TABLE width="100%" align="right" cellpadding="2" cellspacing="2" border="0" background="<%=chipTracContext%>/jsp/includes/images/cancelled_icon.gif">
		</logic:equal>
		<logic:notEqual name="assemblyReleaseForm" property="assemblyReleaseStatus" value="<%=Constants.ASSEMBLY_RELEASE_CANCELLED_STATUS%>" >
		<TABLE width="100%" align="right" cellpadding="2" cellspacing="2" border="0">
		</logic:notEqual>

			<logic:equal name="assemblyReleaseForm" property="assemblyReleaseStatus" value="Issued" >
			<TR>
               <TD colspan="<%=i%>">
               <TABLE width="70%" border="0" align="right" cellpadding="2" cellspacing="2">
                <TR nowrap>
                <TD align="center" class="NArialL" >
                    &nbsp;
                </TD>
                <TD align="right" class="NArialL" >
                    <a href="javascript:printViewAssemblyRelease('<%=chipTracContext%>')" onMouseOver="window.status='Click for Printer-Friendly Version.';return true" onmouseout="window.status='';return true">Printer-Friendly Version</a>
			    </TD>
                <TD align="right" class="NArialL" >
                    <a href="javascript:cancelAssemblyRelease()" onMouseOver="window.status='Click to Cancel Assembly Release.';return true" onmouseout="window.status='';return true">Cancel Assembly Release</a>
			    </TD>

                <TD align="right" class="NArialL" >
                    <a href="javascript:closeAssemblyRelease()" onMouseOver="window.status='Click to Close Assembly Release.';return true" onmouseout="window.status='';return true">Close Assembly Release</a>
			    </TD>
                </TR>
                </TABLE>
                </TD>
            </TR>
			</logic:equal>

            <logic:equal name="assemblyReleaseForm" property="assemblyReleaseStatus" value="Shipped" >
			<TR>
               <TD colspan="<%=i%>">
                   <TABLE width="70%" border="0" align="right" cellpadding="2" cellspacing="2">
                        <TR nowrap>
                            <TD align="center" class="NArialL" >
                                &nbsp;
                            </TD>
                            <TD align="right" class="NArialL" >
                                <a href="javascript:printViewAssemblyRelease('<%=chipTracContext%>')" onMouseOver="window.status='Click for Printer-Friendly Version.';return true" onmouseout="window.status='';return true">Printer-Friendly Version</a>
                            </TD>
                        </TR>
                    </TABLE>
                </TD>
            </TR>
			</logic:equal>


			<TR><TD colspan="<%=i%>"><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='20' width="1"></TD></TR>
			<TR><TD colspan="<%=i%>" width="95%" class="NArialW" align="center">Assembly Release</TD></TR>

			<TR><TD colspan="<%=i%>" align="left" class='NArialL'>&nbsp;<FONT id="errors" color='FF0000'></font></TD></TR>
			<TR><TD colspan="<%=i%>"><chiptrack:errors styleClass="NArialL"/></TD></TR>
			<TR><TD colspan="<%=i%>"><chiptrack:info styleClass="NArialL"/></TD></TR>
			<TR><TD colspan="<%=i%>"><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></TD></TR>

			<TR><TD colspan="<%=i%>"><!--Remove this line to revert back to normal old layout-->
			<TABLE width="100%" border="0"><!--Remove this line to revert back to normal old layout-->

			<TR><TD class="NArialL" width="25%"> Device:</TD>
			<TD class="NArialL" width="25%">&nbsp;<bean:write name="assemblyReleaseForm" property="deviceName" /></TD>
            <html:hidden name="assemblyReleaseForm" property="deviceName" />
			<TD class="NArialL" width="25%"> Ship To:</TD>
			<TD class="NArialL" width="25%"><bean:write name="assemblyReleaseForm" property="locationName" /></TD>
            <html:hidden name = "assemblyReleaseForm" property="locationName" />
			</TR>

			<TR>
			<TD class="NArialL" width="25%">PO Number:<font color="red">*</font></TD>
			<TD class="NArialL" width="25%">
			<logic:equal name="showSaveButton" value="TRUE">
			    &nbsp;<html:text property="poNumber" maxlength="50" styleClass="txfield" size="18"/>
			</logic:equal>
			<logic:notEqual name="showSaveButton" value="TRUE">
			    &nbsp;<html:text name="assemblyReleaseForm" property="poNumber" maxlength="50" styleClass="txfield" size="18" disabled="true" />
			</logic:notEqual>
			</TD>

            <TD class="NArialL" width="25%"> &nbsp;</TD>
			    <TD class="NArialL" width="25%">
                    <html:hidden name="assemblyReleaseForm" property="totalDieQtyPulled" />
                    <html:hidden name="assemblyReleaseForm" property="totalWaferQtyPulled" />
                </TD>
            </TD>
			</TR>

            <!-- added by sharath on 15th June 04. -->
            <TR>
                <TD class="NArialL" width="25%">Release Date:<font color="red">*</font></TD>
                <TD class="NArialL" width="25%">
                <!--A table is inserted only to improve the layout and avoid distortion when window is not in
                maximised mode. Bhaskar on 5 May 2004-->
                <logic:equal name="showSaveButton" value="TRUE">
                <table border="0" width="50%"><tr>
                <td width="80%">
                <html:text name="assemblyReleaseForm" property="releaseDate" maxlength="10" styleClass="txfield" size="16" />
                </td>
                <td width="20%">
                <a href="javascript:openCalendar(document.assemblyReleaseForm.releaseDate)">
                <img onMouseOver="window.status='Click here to select Release Date.';return true" onmouseout="window.status='';return true" border="0" align='center'
                src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=20 width=20></a>
                </td></tr></table>
                </logic:equal>
                <logic:notEqual name="showSaveButton" value="TRUE">
                &nbsp;<html:text name="assemblyReleaseForm" property="releaseDate" maxlength="10" styleClass="txfield" size="16" disabled="true" />
                </logic:notEqual>
                </TD>
			    <TD class="NArialL" width="25%"> Total Qty Pulled:</TD>
			    <TD class="NArialL" width="25%">
                    <input type="text" name="totalQtyPulled" Class="valuetxfield" size="18" disabled = "true" />
                </td>
			</TR>

			</TABLE><!--Remove this line to revert back to normal old layout-->
			</TD></TR><!--Remove this line to revert back to normal old layout-->

			<TR><TD colspan="<%=i%>" width="100%"><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height="20" width="1"></TD></TR>


			<TR><TD width="100%" colspan="<%=i%>"><!--Remove this line to revert back to normal old layout-->

            <table border="0" width="85%" id="AutoNumber2" height="208" align="center">
            <TR><TD align="left" class='NArialL' colspan="4">&nbsp;<FONT id="lotsMessage" color='FF0000'></font></TD></TR>
              <tr bgcolor="#993333" border = "0">
                <td width="10%" height="1" align="center" border = "2" class='NArialL'><font color="#FFFFFF">Select</font></td>
                <td width="20%" height="1" align="center" class='NArialL'><font color="#FFFFFF">Lot Number</font></td>
                <td width="30%" height="1" align="center">
                <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber3">
                  <tr>
                    <td width="100%" colspan="3" align="center" class='NArialL'><font color="#FFFFFF" >Current Quantity</font></td>
                  </tr>
                  <tr>
                    <td width="50%" align="center" class='NArialL'><font color="#FFFFFF">Wafer</font></td>
                    <td width="50%" align="center" class='NArialL'><font color="#FFFFFF">Die</font></td>
                  </tr>
                </table>
                </td>

                </td>
                <td width="30%" height="1" align="center">
                <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber4">
                  <tr>
                    <td width="100%" colspan="3" align="center" class='NArialL' nowrap><font color="#FFFFFF" >Quantity Pulled</font></td>
                  </tr>
                  <tr>
                    <td width="50%" align="center" class='NArialL'><font color="#FFFFFF">Wafer</font></td>
                    <td width="50%" align="center" class='NArialL'><font color="#FFFFFF">Die</font></td>
                  </tr>
                  </table>
                </td>

                </td>
              </tr>

      <nested:iterate id = "lotList" property="lotList" type="com.scalar.chiptrack.operations.assemblyrelease.AssemblyRelease" scope="session">
			<logic:notEqual name="assemblyReleaseForm" property="assemblyReleaseStatus" value="<%=Constants.ASSEMBLY_RELEASE_CANCELLED_STATUS%>" >
            <!-- Added by SharatH on 10th June 04-->
            <%
                if( forFab == 0 && lotList.getProcessTypeName().equalsIgnoreCase( "FAB" ) )
                {
                    out.println( "<TR><TD colspan='4' width='80%' class='NArialL' bgcolor='#D1D1D1' align='Left'>&nbsp;FAB </TD></TR>" );
                    forFab++;
                }
                if( forWaferStore == 0 && lotList.getProcessTypeName().equalsIgnoreCase( "Wafer Store" ) )
                {
                    out.println( "<TR><TD colspan='4' width='80%' class='NArialL' bgcolor='#D1D1D1' align='Left'>&nbsp;Wafer Store </TD></TR>" );
                    forWaferStore++;
                }
                if( forSort == 0 && lotList.getProcessTypeName().equalsIgnoreCase( "SORT" ) )
                {
                    out.println( "<TR><TD colspan='4' width='80%' class='NArialL' bgcolor='#D1D1D1' align='Left'>&nbsp;SORT </TD></TR>" );
                    forSort++;
                }
                if( forDieBank == 0 && lotList.getProcessTypeName().equalsIgnoreCase( "Die Bank" ) )
                {
                    out.println( "<TR><TD colspan='4' width='80%' class='NArialL' bgcolor='#D1D1D1' align='Left'>&nbsp;Die Bank </TD></TR>" );
                    forDieBank++;
                }

            %>

      <tr bgcolor="#DEE1E2" ID='head0' >
      <%
        int waferListSize = lotList.getWafersListCount();
        String tempString = "javascript:addLotQuantity(" + rowCount + ")";
      %>

        <td width="16%" height="19"  align="center" class="NArialL">
            <%
            if( lotList.getProcessTypeName().equalsIgnoreCase( "SORT" ) ) {
                if( lotList.getWafersListCount()== 0 ) {
            %>
                    <nested:checkbox property="selectLot" styleClass="txfield" onclick="<%=tempString%>"/>
            <%  } else { %>
                    <nested:checkbox property="selectLot" styleClass="txfield" />
            <%  }
            } else if( lotList.getProcessTypeName().equalsIgnoreCase( "Die Bank" ) ) {
                if( lotList.getWafersListCount()== 0 ) {
            %>
                    <nested:checkbox property="selectLot" styleClass="txfield" onclick="<%=tempString%>"/>
            <% } else { %>
                    <nested:checkbox property="selectLot" styleClass="txfield" />
            <%  }
            %>

            <% } else {%>
                <nested:checkbox property="selectLot" styleClass="txfield" onclick="<%=tempString%>"/>
            <% }%>
            <nested:hidden property = "selectLotOld"/>
            <nested:hidden property = "processTypeName"/>
            <nested:hidden property = "grossDiePerWafer"/>
            <nested:hidden property = "processStepId" />
            <nested:hidden property = "lotId" />
        </td>

        <%
        if( lotList.getProcessTypeName().equalsIgnoreCase( "SORT" ) ) {
        %>
           <td width="17%" height="19" align="left" <%if( waferListSize > 0){%> CLASS="HEADING" onclick = "callFlash('rowName<%=rowCount%>')" <%}else{%> class="NArialL" <%}%> ><%if( waferListSize > 0){%><font class='NArialL'><IMG src="<%=chipTracContext%>/jsp/includes/images/bullet2.GIF" width="12" height="12"></font>&nbsp;<%}%><nested:write property="lotNumber" /></td>
        <%
        } else if( lotList.getProcessTypeName().equalsIgnoreCase( "Die Bank" ) ) {
        %>
           <td width="17%" height="19" align="left" <%if( waferListSize > 0){%> CLASS="HEADING" onclick = "callFlash('rowName<%=rowCount%>')" <%}else{%> class="NArialL" <%}%> ><%if( waferListSize > 0){%><font class='NArialL'><IMG src="<%=chipTracContext%>/jsp/includes/images/bullet2.GIF" width="12" height="12"></font>&nbsp;<%}%><nested:write property="lotNumber" /></td>
        <%
        } else {
        %>
            <td width="17%" height="19" align="left" class="NArialL"><nested:write property="lotNumber" /></td>
        <%
        }
        %>

        <td width="17%" height="19" align="center">
        <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber4" align="right" height="19">
          <tr>
            <td width="50%" align="center" valign="top"><nested:text property="waferQuantity" styleClass="valuetxfield" size="16" disabled = "true" readonly = "true" onkeypress="javascript:numericFieldKeyPress( this )"/>&nbsp;</td>
            <td width="50%" align="center" valign="top">
                <%
                if( lotList.getProcessTypeName().equalsIgnoreCase( "Die Bank" ) ) {
                %>
                    <nested:text property="dieQuantity" styleClass="valuetxfield" size="16" disabled = "true" readonly = "true" onkeypress="javascript:numericFieldKeyPress( this )"/>
                <%
                }
                if( lotList.getProcessTypeName().equalsIgnoreCase( "SORT" ) ) {
                %>
                    <nested:text property="dieQuantity" styleClass="valuetxfield" size="16" disabled = "true" readonly = "true" onkeypress="javascript:numericFieldKeyPress( this )"/>
                <%}%>
            </td>
          </tr>
        </table>
        </td>
            <td width="17%" height="19"  align="center"><!--nested:text property="quantityPull" styleClass="valuetxfield" size="16" disabled = "true" onchange="<%//=tempString%>"/-->
                <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber4" align="right" height="19">
                    <tr>
                        <td width="50%" align="center" height="19" valign="top">
                           <nested:text property="waferQuantityPull" styleClass="valuetxfield"  size="16" disabled = "true" onblur="<%=tempString%>" onkeypress="javascript:numericFieldKeyPress( this )"/>&nbsp;
                        </td>
                        <td width="50%" align="center" height="19" valign="top">
                            <%
                            if( lotList.getProcessTypeName().equalsIgnoreCase( "Die Bank" ) || lotList.getProcessTypeName().equalsIgnoreCase( "SORT" ) )
                            {
                            %>
                                <nested:text property="dieQuantityPull" styleClass="valuetxfield" size="16" disabled = "true" onblur="<%=tempString%>" onkeypress="javascript:numericFieldKeyPress( this )"/>
                            <%
                            }
                            if( lotList.getProcessTypeName().equalsIgnoreCase( "FAB" ) || lotList.getProcessTypeName().equalsIgnoreCase( "WAFER STORE" ))
                            {
                            %>
                                <nested:hidden property="dieQuantityPull" />
                            <%}%>
                        </td>
                    </tr>
                </table>
                <nested:hidden property="wafersListCount" />
            </td>

        </tr>

      <tr>
        <td width="100%" height="1" colspan="4">
      <table border="0" width="100%" id="rowName<%=rowCount%>" style="display=none"  height="79">
        <% if ( waferListSize > 0){ %>

		  <tr>
			<td width="100%" height="19" colspan="17" class="NArialL">
			Bin Information</td>
		  </tr>
          <tr bgcolor="#707070">
            <td width="5%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Wafer<br>Id</font></font></td>
            <td width="5%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>1</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>2</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>3</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>4</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>5</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>6</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>7</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>8</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>9</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>10</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>11</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>12</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>13</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>14</font></font></td>
			<td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>15</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Total</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Select</font></font></td>
          </tr>
         <%}
            if( lotList.getProcessTypeName().equalsIgnoreCase( "SORT" ) || lotList.getProcessTypeName().equalsIgnoreCase( "Die Bank" ) ) {
                if( lotList.getWafersListCount()!= 0 ) {
         %>
                <nested:iterate id = "waferList" property = "assemblyReleaseWaferInfoList" type="com.scalar.chiptrack.operations.assemblyrelease.AssemblyReleaseWaferInfo" >
                      <tr bgcolor = "#fffee">
                        <td width="5%" align="center" height="18" class="NArialL"><nested:write property = "waferId"/></td>
                        <td width="5%" align="center" height="18" class="NArialL"><nested:write property = "bin1"/></td>
                        <td width="6%" align="center" height="18" class="NArialL"><nested:write property = "bin2"/></td>
                        <td width="6%" align="center" height="18" class="NArialL"><nested:write property = "bin3"/></td>
                        <td width="6%" align="center" height="18" class="NArialL"><nested:write property = "bin4"/></td>
                        <td width="6%" align="center" height="18" class="NArialL"><nested:write property = "bin5"/></td>
                        <td width="6%" align="center" height="18" class="NArialL"><nested:write property = "bin6"/></td>
                        <td width="6%" align="center" height="18" class="NArialL"><nested:write property = "bin7"/></td>
                        <td width="6%" align="center" height="18" class="NArialL"><nested:write property = "bin8"/></td>
                        <td width="6%" align="center" height="18" class="NArialL"><nested:write property = "bin9"/></td>
                        <td width="6%" align="center" height="18" class="NArialL"><nested:write property = "bin10"/></td>
                        <td width="6%" align="center" height="18" class="NArialL"><nested:write property = "bin11"/></td>
                        <td width="6%" align="center" height="18" class="NArialL"><nested:write property = "bin12"/></td>
                        <td width="6%" align="center" height="18" class="NArialL"><nested:write property = "bin13"/></td>
                        <td width="6%" align="center" height="18" class="NArialL"><nested:write property = "bin14"/></td>
                        <td width="6%" align="center" height="18" class="NArialL"><nested:write property = "bin15"/></td>
                        <td width="6%" align="center" height="18"><nested:text property="totalBinQuantity" styleClass="valuetxfield" size="10" disabled = "true" readonly = "true" /></td>
                        <td width="6%" height="18"  align="center"><nested:hidden property = "waferSelectedOld"/>
                        <nested:checkbox property = "waferSelected" onclick  = "javascript:addWaferQty();"/></td>

                      </tr>
                 </nested:iterate>
        <%  }
                }
        %>
        </table>

        </td>
      </tr>

    </logic:notEqual>

    <logic:equal name="assemblyReleaseForm" property="assemblyReleaseStatus" value="<%=Constants.ASSEMBLY_RELEASE_CANCELLED_STATUS%>" >
      <!-- Added by SharatH on 10th June 04-->
      <nested:equal property="selectLot" value="true">  <!-- Added by Suresh Yeruva on [ 5 AUG 2004 ]-->
            <%
                if( forFab == 0 && lotList.getProcessTypeName().equalsIgnoreCase( "FAB" ) )
                {
                    out.println( "<TR><TD colspan='4' width='80%' class='NArialL' bgcolor='#D1D1D1' align='Left'>&nbsp;FAB </TD></TR>" );
                    forFab++;
                }
                if( forWaferStore == 0 && lotList.getProcessTypeName().equalsIgnoreCase( "Wafer Store" ) )
                {
                    out.println( "<TR><TD colspan='4' width='80%' class='NArialL' bgcolor='#D1D1D1' align='Left'>&nbsp;Wafer Store </TD></TR>" );
                    forWaferStore++;
                }
                if( forSort == 0 && lotList.getProcessTypeName().equalsIgnoreCase( "SORT" ) )
                {
                    out.println( "<TR><TD colspan='4' width='80%' class='NArialL' bgcolor='#D1D1D1' align='Left'>&nbsp;SORT </TD></TR>" );
                    forSort++;
                }
                if( forDieBank == 0 && lotList.getProcessTypeName().equalsIgnoreCase( "Die Bank" ) )
                {
                    out.println( "<TR><TD colspan='4' width='80%' class='NArialL' bgcolor='#D1D1D1' align='Left'>&nbsp;Die Bank </TD></TR>" );
                    forDieBank++;
                }

            %>

<tr bgcolor="#DEE1E2" ID='head0' >
      <%
          int waferListSize = lotList.getWafersListCount();
      %>

        <nested:hidden property = "processTypeName"/>
        <nested:hidden property = "grossDiePerWafer"/>
        <td width="16%" height="19"  align="center" class="NArialL">
            <nested:checkbox property="selectLot" styleClass="txfield" disabled="true"/>
        </td>

        <%
        if( lotList.getProcessTypeName().equalsIgnoreCase( "SORT" ) ) {
        %>
           <td width="17%" height="19" align="left" <%if( waferListSize > 0){%> CLASS="HEADING" onclick = "callFlash('rowName<%=rowCount%>')" <%}else{%> class="NArialL" <%}%> ><%if( waferListSize > 0){%><font class='NArialL'><IMG src="<%=chipTracContext%>/jsp/includes/images/bullet2.GIF" width="12" height="12"></font>&nbsp;<%}%><nested:write property="lotNumber" /></td>
        <%
        } else if( lotList.getProcessTypeName().equalsIgnoreCase( "Die Bank" ) ) {
        %>
           <td width="17%" height="19" align="left" <%if( waferListSize > 0){%> CLASS="HEADING" onclick = "callFlash('rowName<%=rowCount%>')" <%}else{%> class="NArialL" <%}%> ><%if( waferListSize > 0){%><font class='NArialL'><IMG src="<%=chipTracContext%>/jsp/includes/images/bullet2.GIF" width="12" height="12"></font>&nbsp;<%}%><nested:write property="lotNumber" /></td>
        <%
        } else {
        %>
            <td width="17%" height="19" align="left" class="NArialL"><nested:write property="lotNumber" /></td>
        <%
        }
        %>

        <td width="17%" height="19" align="center">
        <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber4" align="right" height="19">
          <tr>
            <td width="50%" align="center" valign="top"><nested:text property="waferQuantity" styleClass="valuetxfield" size="16" disabled = "true" readonly = "true"/>&nbsp;</td>
            <td width="50%" align="center" valign="top">
                <%
                if( lotList.getProcessTypeName().equalsIgnoreCase( "Die Bank" ) ) {
                %>
                    <nested:text property="dieQuantity" styleClass="valuetxfield" size="16" disabled = "true" readonly = "true"/>
                <%
                }
                if( lotList.getProcessTypeName().equalsIgnoreCase( "SORT" ) ) {
                %>
                    <nested:text property="dieQuantity" styleClass="valuetxfield" size="16" disabled = "true" readonly = "true"/>
                <%}%>
            </td>
          </tr>
        </table>
        </td>
            <td width="17%" height="19"  align="center"><!--nested:text property="quantityPull" styleClass="valuetxfield" size="16" disabled = "true" onchange="<%//=tempString%>"/-->
                <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber4" align="right" height="19">
                    <tr>
                        <td width="50%" align="center" height="19" valign="top">
                           <nested:text property="waferQuantityPull" styleClass="valuetxfield"  size="16" disabled = "true"/>&nbsp;
                        </td>
                        <td width="50%" align="center" height="19" valign="top">
                            <%
                            if( lotList.getProcessTypeName().equalsIgnoreCase( "Die Bank" ) || lotList.getProcessTypeName().equalsIgnoreCase( "SORT" ) )
                            {
                            %>
                                <nested:text property="dieQuantityPull" styleClass="valuetxfield" size="16" disabled = "true"/>
                            <%
                            }
                            if( lotList.getProcessTypeName().equalsIgnoreCase( "FAB" ) || lotList.getProcessTypeName().equalsIgnoreCase( "WAFER STORE" ))
                            {
                            %>
                                <nested:hidden property="dieQuantityPull" />
                            <%}%>
                        </td>
                    </tr>
                </table>
            </td>
			<nested:hidden property="wafersListCount" />
        </tr>

      <tr>
        <td width="100%" height="1" colspan="4">
      <table border="0" width="100%" id="rowName<%=rowCount%>" style="display=block"  height="79">
        <% if ( waferListSize > 0){ %>

		  <tr>
			<td width="100%" height="19" colspan="17" class="NArialL">
			Bin Information</td>
		  </tr>
          <tr bgcolor="#707070">
            <td width="5%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Wafer<br>Id</font></font></td>
            <td width="5%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>1</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>2</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>3</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>4</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>5</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>6</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>7</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>8</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>9</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>10</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>11</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>12</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>13</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>14</font></font></td>
			<td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Bin<br>15</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Total</font></font></td>
            <td width="6%" align="center" height="40"><font class='NArialL'>
			    <font color="#FFFFFF">Select</font></font></td>
          </tr>
         <%}%>
        <!--logic:equal name="lotList" property="processTypeName" value="SORT" -->
        <%  if( lotList.getProcessTypeName().equalsIgnoreCase("SORT") || lotList.getProcessTypeName().equalsIgnoreCase("Die Bank") ){
                if( lotList.getWafersListCount()!= 0 ) {
        %>
                <nested:iterate id = "waferList" property = "assemblyReleaseWaferInfoList" type="com.scalar.chiptrack.operations.assemblyrelease.AssemblyReleaseWaferInfo" >
                      <tr bgcolor = "#fffee">
                        <td width="5%" align="center" height="18" class="NArialL"><nested:write property = "waferId"/></td>
                        <td width="5%" align="center" height="18" class="NArialL"><nested:write property = "bin1"/></td>
                        <td width="6%" align="center" height="18" class="NArialL"><nested:write property = "bin2"/></td>
                        <td width="6%" align="center" height="18" class="NArialL"><nested:write property = "bin3"/></td>
                        <td width="6%" align="center" height="18" class="NArialL"><nested:write property = "bin4"/></td>
                        <td width="6%" align="center" height="18" class="NArialL"><nested:write property = "bin5"/></td>
                        <td width="6%" align="center" height="18" class="NArialL"><nested:write property = "bin6"/></td>
                        <td width="6%" align="center" height="18" class="NArialL"><nested:write property = "bin7"/></td>
                        <td width="6%" align="center" height="18" class="NArialL"><nested:write property = "bin8"/></td>
                        <td width="6%" align="center" height="18" class="NArialL"><nested:write property = "bin9"/></td>
                        <td width="6%" align="center" height="18" class="NArialL"><nested:write property = "bin10"/></td>
                        <td width="6%" align="center" height="18" class="NArialL"><nested:write property = "bin11"/></td>
                        <td width="6%" align="center" height="18" class="NArialL"><nested:write property = "bin12"/></td>
                        <td width="6%" align="center" height="18" class="NArialL"><nested:write property = "bin13"/></td>
                        <td width="6%" align="center" height="18" class="NArialL"><nested:write property = "bin14"/></td>
                        <td width="6%" align="center" height="18" class="NArialL"><nested:write property = "bin15"/></td>
                        <td width="6%" align="center" height="18"><nested:text property="totalBinQuantity" styleClass="valuetxfield" size="10" disabled = "true" readonly = "true" /></td>
                        <td width="6%" height="18"  align="center"><nested:hidden property = "waferSelectedOld"/>
                        <nested:checkbox property = "waferSelected" disabled="true"/></td>
                      </tr>
                 </nested:iterate>
        <!--/logic:equal-->
        <%  }
                }
        %>
        </table>

        </td>
      </tr>

      </nested:equal>
    </logic:equal>
    <% rowCount++; %>
    </nested:iterate>

    <%
                if( forFab == 0 )
                {
                   out.println( "<TR><TD colspan='4' class='NArialL' bgcolor='#D1D1D1' align='Left'>&nbsp;FAB </TD></TR><TR bgcolor='#DEE1E2'><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>" );
                }
                if( forWaferStore == 0 )
                {
                   out.println( "<TR><TD colspan='4' class='NArialL' bgcolor='#D1D1D1' align='Left'>&nbsp;Wafer Store </TD></TR><TR bgcolor='#DEE1E2'><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>" );
                }
                if( forSort == 0 )
                {
                   out.println( "<TR><TD colspan='4' class='NArialL' bgcolor='#D1D1D1' align='Left'>&nbsp;SORT </TD></TR><TR bgcolor='#DEE1E2'><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>" );
                }
                if( forDieBank == 0 )
                {
                   out.println( "<TR><TD colspan='4' class='NArialL' bgcolor='#D1D1D1' align='Left'>&nbsp;Die Bank </TD></TR><TR bgcolor='#DEE1E2'><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>" );
                }

   %>



</table>
			<!--Remove this line to revert back to normal old layout-->
			</TD></TR><!--Remove this line to revert back to normal old layout-->

			<TR><TD colspan="4" width="100%"><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height="10" width="1"></TD></TR>

			<TR><TD width="100%" class="NArialL" align="center" bgcolor="#DEE1E2" colspan="10">Build Information </TD></TR>

			<TR><TD colspan="<%=i%>" width="100%"><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height="10" width="1"></TD></TR>
			<TR><TD width="100%" colspan="<%=i%>" align="center">

            <logic:notEqual name="showSaveButton" value="TRUE">
            <TABLE width="100%" border="0">
				<TR><TD class="NArialL" width="25%"> Bonding Diagram:<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="bondingDiagram" maxlength="50" styleClass="txfield" size="24" disabled="true" />
				</TD>
				<TD class="NArialL" width="25%"> PN Marking:<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="pnMarking" maxlength="50" styleClass="txfield" size="24" disabled="true" />
				</TD>
				</TR>

				<TR>
				<TD class="NArialL" width="25%"> Package:<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="packaze" maxlength="50" styleClass="txfield" size="24" disabled="true" />
				</TD>
				<TD class="NArialL" width="25%"> Category:<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="category" maxlength="50" styleClass="txfield" size="24" disabled="true" />
				</TD>
				</TR>

                <TR>
				<TD class="NArialL" width="25%"> Fuse File Location:<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="fuseFileLocation" maxlength="50" styleClass="txfield" size="24" disabled="true" />
				</TD>
				<TD class="NArialL" width="25%"> Wafer Map Location:<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="waferMapLocation" maxlength="50" styleClass="txfield" size="24" disabled="true" />
				</TD>
				</TR>

                <TR>
				<TD class="NArialL" width="25%"> Mark At Assembly(MAA):<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="markAtAssembly" maxlength="50" styleClass="txfield" size="24" disabled="true" />
				</TD>
				<TD class="NArialL" width="25%"> Mark At Test(MAT):<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="markAtTest" maxlength="50" styleClass="txfield" size="24" disabled="true" />
				</TD>
				</TR>

                <TR>
				<TD class="NArialL" width="25%"> Line-1:<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="line1" maxlength="50" styleClass="txfield" size="24" disabled="true" />
				</TD>
				<TD class="NArialL" width="25%"> Line-2:<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="line2" maxlength="50" styleClass="txfield" size="24" disabled="true" />
				</TD>
				</TR>

                <TR>
				<TD class="NArialL" width="25%"> Line-3:<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="line3" maxlength="50" styleClass="txfield" size="24" disabled="true" />
				</TD>
				<TD class="NArialL" width="25%"> Line-4:<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="line4" maxlength="50" styleClass="txfield" size="24" disabled="true" />
				</TD>
				</TR>

                <TR>
				<TD class="NArialL" width="25%"> Line-5:<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="line5" maxlength="50" styleClass="txfield" size="24" disabled="true" />
				</TD>
				<TD class="NArialL" width="25%"> Line-6:<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="line6" maxlength="50" styleClass="txfield" size="24"  disabled="true" />
				</TD>
				</TR>

                <TR>
				<TD class="NArialL" width="25%"> Build Instruction:<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="buildInstruction" maxlength="50" styleClass="txfield" size="24" disabled="true" />
				</TD>
                <TD class="NArialL" width="25%"> Special Instructions:<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:textarea name="assemblyReleaseForm" property="specialInstruction" styleClass="txfield" rows="4" cols ="40" disabled="true" onkeydown="javascript:setTextAreaMaxLength(document.assemblyReleaseForm.specialInstruction,2000)" onkeyup="javascript:setTextAreaMaxLength(document.assemblyReleaseForm.specialInstruction,2000)"/>
				</TD>
				</TR>
            </TABLE>
         </logic:notEqual>

         <logic:equal name="showSaveButton" value="TRUE">
            <TABLE width="100%" border="0">
				<TR><TD class="NArialL" width="25%"> Bonding Diagram:<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="bondingDiagram" maxlength="50" styleClass="txfield" size="24" />
				</TD>
				<TD class="NArialL" width="25%"> PN Marking:<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="pnMarking" maxlength="50" styleClass="txfield" size="24" />
				</TD>
				</TR>

				<TR>
				<TD class="NArialL" width="25%"> Package:<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="packaze" maxlength="50" styleClass="txfield" size="24" />
				</TD>
				<TD class="NArialL" width="25%"> Category:<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="category" maxlength="50" styleClass="txfield" size="24" />
				</TD>
				</TR>

                <TR>
				<TD class="NArialL" width="25%"> Fuse File Location:<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="fuseFileLocation" maxlength="50" styleClass="txfield" size="24" />
				</TD>
				<TD class="NArialL" width="25%"> Wafer Map Location:<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="waferMapLocation" maxlength="50" styleClass="txfield" size="24" />
				</TD>
				</TR>

                <TR>
				<TD class="NArialL" width="25%"> Mark At Assembly(MAA):<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="markAtAssembly" maxlength="50" styleClass="txfield" size="24" />
				</TD>
				<TD class="NArialL" width="25%"> Mark At Test(MAT):<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="markAtTest" maxlength="50" styleClass="txfield" size="24" />
				</TD>
				</TR>

                <TR>
				<TD class="NArialL" width="25%"> Line-1:<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="line1" maxlength="50" styleClass="txfield" size="24" />
				</TD>
				<TD class="NArialL" width="25%"> Line-2:<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="line2" maxlength="50" styleClass="txfield" size="24" />
				</TD>
				</TR>

                <TR>
				<TD class="NArialL" width="25%"> Line-3:<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="line3" maxlength="50" styleClass="txfield" size="24" />
				</TD>
				<TD class="NArialL" width="25%"> Line-4:<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="line4" maxlength="50" styleClass="txfield" size="24" />
				</TD>
				</TR>

                <TR>
				<TD class="NArialL" width="25%"> Line-5:<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="line5" maxlength="50" styleClass="txfield" size="24" />
				</TD>
				<TD class="NArialL" width="25%"> Line-6:<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="line6" maxlength="50" styleClass="txfield" size="24" />
				</TD>
				</TR>

                <TR>
				<TD class="NArialL" width="25%"> Build Instruction:<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:text name="assemblyReleaseForm" property="buildInstruction" maxlength="50" styleClass="txfield" size="24" />
				</TD>
                <TD class="NArialL" width="25%"> Special Instructions:<!--font color="red">*</font--></TD>
				<TD class="NArialL" width="25%">
				<html:textarea name="assemblyReleaseForm" property="specialInstruction" styleClass="txfield" rows="4" cols ="40" onkeydown="javascript:setTextAreaMaxLength(document.assemblyReleaseForm.specialInstruction,2000)" onkeyup="javascript:setTextAreaMaxLength(document.assemblyReleaseForm.specialInstruction,2000)"/>
				</TD>
				</TR>
            </TABLE>
        </logic:equal>

            </TD></TR>
			<!--All the important and needed parameters are being placed in the single row as hidden parameters just for easy maintainance of code Bhaskar on 5 May 2004. Please check before changing the layout at any other point of time.-->
			<TR><TD colspan="4" width="100%">
			<html:hidden name="assemblyReleaseForm" property="productId" />
			<html:hidden name="assemblyReleaseForm" property="baseProductName" />
			<html:hidden name="assemblyReleaseForm" property="locationId" />
            <html:hidden name="assemblyReleaseForm" property="fromLocationId" />
			<html:hidden name="assemblyReleaseForm" property="processStepId" />
			<!--h t m l : h i d d e n   name="assemblyReleaseForm" property="processTypeName" /-->
			<html:hidden name="assemblyReleaseForm" property="assemblyReleaseId" />
			<html:hidden name="assemblyReleaseForm" property="assemblyReleaseStatusId" />
			<html:hidden name="assemblyReleaseForm" property="assemblyReleaseStatus" />
			</TD></TR>

			</TD>
			</TR>
			<TR><TD colspan="4" width="100%"><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height="20" width="1"></TD></TR>

			<logic:equal name="showSaveButton" value="TRUE">
			<TR><TD class="NArialL" width="100%" colspan="<%=i%>" align="center">
				<a href="javascript:saveAssemblyStatus()">
				<img border="0" src="<%=chipTracContext%>/jsp/includes/images/save.gif" onMouseOver="window.status='Click to Save Assembly Release Details.';return true" onmouseout="window.status='';return true"></a>
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<a href="<%=chipTracContext%>/assemblyRelease.do">
				<img border="0" src="<%=chipTracContext%>/jsp/includes/images/cancel.gif" onMouseOver="window.status='Click to Cancel Assembly Release.';return true" onmouseout="window.status='';return true"></a>
			</TD></TR>
			</logic:equal>
			<logic:notEqual name="showSaveButton" value="TRUE">
			<TR><TD class="NArialL" width="100%" colspan="<%=i%>" align="center">
				<a href="<%=chipTracContext%>/assemblyRelease.do">
				<img border="0" src="<%=chipTracContext%>/jsp/includes/images/cancel.gif" onMouseOver="window.status='Click to Cancel Assembly Release.';return true" onmouseout="window.status='';return true"></a>
			</TD></TR>
			</logic:notEqual>

			<TR><TD colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='20'></TD></TR>
		</TABLE>

		<input type="hidden" name="action"/>
        <input type="hidden" value = "<%=rowCount%>" name = "noOfRows"/>
	</html:form>

<!-- till here -->
<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
</TABLE>

<!-- Footer starts here -->
<%@ include file="/jsp/includes/footer.jsp" %>
<!-- footer end here -->

</BODY>
</HTML>